Method for file transfer

ABSTRACT

A method for allowing data to be transferred in parallel over several input/output channels simultaneously. When a file is opened within an application program, a system library routine tasked with allocating input/output channels checks to see if multiple channels have been defined by control commands separate from the application. If the multiple channels have been so defined, the driver will open multiple channels for data transfer in a manner independent of the application. Existing applications can use this technique to perform striped input/output without requiring modification.

This application is a continuation, of application Ser. No. 07/461,343, filed Jan. 5, 1990, now abandoned.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention relates generally to input and output for computer systems, and more specifically to a method for providing data transfer over multiple input/output channels.

2. Description of the Related Art

For many computer system applications, the main performance bottleneck is data input and output. The data transfer rate between the processor and a storage device, such as a disk, is much slower than the execution rate of the application.

In larger computer systems, access to multiple disk storage devices is often available. Each device can be accessed by an input/output channel. With proper design, an application can use more than one channel for input and output to a single logical file. This is done by splitting a logical file up into several physical files each containing part of the logical file, with each physical file preferably residing on a separate storage device. This has the effect of increasing the input or output rate, since simultaneous input/output can be performed in parallel over the multiple channels. The technique of splitting a file over multiple channels for input/output is sometimes known as "striping."

Implementation of file striping can be difficult if it is done by an application designer. Striping is preferably accomplished by supplying appropriate facilities as part of the library routines within the operating system. However, striping often cannot be fully utilized when it is introduced into an existing installation for several reasons. First, application programmers must be aware of the fact that striping is now available and remember to use the correct commands to invoke it. In addition, existing applications cannot take advantage of the new capability unless they are modified and recompiled.

It would be desirable to provide input/output striping to existing applications without modification of the applications. It would also be desirable to allow application developers to take advantage of file striping without having to learn new programming techniques.

SUMMARY OF THE INVENTION

It is therefore an object of the present invention to provide input/output for an application using more than one data channel for a single data object such as a file.

It is another object of the present invention to provide such input/output without requiring special knowledge on the part of an application designer.

It is another object of the present invention to provide such parallel input/output for existing applications without requiring their modification.

Therefore, according to the present invention, a method is described for allowing data to be transferred in parallel over several input/output channels simultaneously. When a file is opened within an application program, a system library routine tasked with allocating input/output channels checks to see if multiple channels have been defined by control commands separate from the application. If the multiple channels have been so defined, the driver will open multiple channels for data transfer in a manner independent of the application. Existing applications can use this technique to perform striped input/output without requiring modification.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself however, as well as a preferred mode of use, further objects and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:

FIG. 1 is a block diagram showing input/output between data storage devices and an application program;

FIG. 2 is a chart illustrating logical file block assignments to different physical files for striped input/output;

FIG. 3 illustrates a preferred technique for using the present invention; and

FIG. 4 is a flowchart illustrating operation of a library routine according to the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

FIG. 1 illustrates a portion of a computer system on which an application program 10 is executed. The application accesses one or more disk units through physical data transfer channels 14 and disk drive interface 16.

Typically, each channel 14 is used for transfer of data to and from a single file located on a single storage device 12. Application program 10 can have several files open at the same time, using a different input/output channel for each file. Also, different application programs can share access to the disk devices 12 by making use of the different input/output channels.

In order to increase the data transfer rate for input and output between the application program 10 and the disk storage units 12, the channels 14 can be used to transfer data in parallel to and from a single logical file. This technique is known as file "striping" and is illustrated in connection with FIG. 2.

FIG. 2 shows an example of a single logical file 18 which has been striped onto four physical files 20, 22, 24, 26. The blocks of the logical file 18 are sequentially numbered beginning with block 1. The blocks are assigned to the various files sequentially, so that physical file 1 is used for storage of logical blocks 1, 5, 9, and so forth. When a sequential read of four blocks is requested by the application program 10, the four physical files 20-26 are read simultaneously over the four channels 14 to transfer all four blocks in the time that one block can be transferred over a single channel. The ability to transfer data in this manner can result in an input/output speedup proportional to the number of physical files over which a logical file is striped. For the example of FIG. 2, wherein four physical files are used for striping a single logical file, data input/output can be performed at an increased rate of up to four times the rate found with one physical file.

FIG. 3 illustrates how the present invention can be used in a manner which is transparent to an application program. The example of FIG. 3 uses FORTRAN as the source language of the application program 10. When an application is executed, the code to be executed 28 includes control statements 30 and object code corresponding to the actual source code for the application 32. Control statements are used to issue commands to the run time system, and define the environment in which the application 10 will be run. Included in the control statements 30 are data definition (DD) statements which describe how input/output is to be performed. Each data definition statement is assigned an input/output channel, and has a name used to identify input and output through that channel.

When a file is opened within the application, a system library procedure associates an input/output channel with that file. The channel used is one defined in the data definition statement having the name corresponding to the file open statement. If the open statement does not include a specific name, a reserved default name, such as FTxxF001, is assigned.

By convention, the preferred embodiment uses slightly different names in the data definition statements for files which are to be striped over parallel channels. An example of these is shown in the control statements 30, wherein the names are all reserved and of the form FTxxPnnn, where "xx" is a unit number used in a FORTRAN open statement, and "nnn" is a number used to identify the parallel channels for such file. In FIG. 3, the data definition statements shown are for opening four parallel channels for unit 10, so that a file will be striped as shown in FIG. 2.

The open statement in the source code 32 does not assign a specific channel name to the file. Previously, a default name such as FT10F001 would be assigned to a single physical file. Preferably, data transfer to the logical file will be performed instead over the four channels defined in the data definition statements within control commands 30.

Referring to FIG. 4, a preferred method is shown by which the library routine determines whether to perform file striping when unit "xx" is opened, and how many channels are to be used if striping is done. When the appropriate routine is called, it determines the contents of the open statement 40 and checks to see whether a name was defined 42. If a name was defined within the open statement, a check is made to see whether the defined name is the reserved name FTxxP001 44. If not, striping is not used 46 and the file is opened in the usual way using a single channel.

If the result of step 44 is yes, a counter variable `nnn` is set equal to `002` 48. The routine will then determine how many channels have been defined for striping the opened file.

The name FTxxPnnn is selected 50, and a check made 52 to see if that name has been defined in a data definition statement. If it has been defined, `nnn` is incremented 54, and control returns to step 50. The loop of steps 50, 52, and 54 is continued until no more names have been defined.

When the result of step 52 is NO, `nnn` is decremented by `001` 56. At this point, the library routine has determined how many channels are to be used for striping the file. The channels are then allocated for file striping 58 as known in the art.

In many cases, an unnamed open statement such as shown in FIG. 3 is used, in which no file name defined. If the NO branch is taken from step 42, file name FTxxP001 is selected 60, and a check is made to see whether it is defined 62. If it is defined in a data definition statement, control passes to step 48 and file striping is used as described above. If FTxxP001 is not defined, the name FTxxF001 is selected as the default name 64 and striping is not used 66.

The decision-making technique shown in FIG. 4 is used by the library routine for allocating channels to allow file striping to be performed where possible in a manner transparent to the application program. When a file is opened with no defined file name, as is often the case, the simple inclusion of the proper data definition statements within the control statements causes file striping to be performed. If file striping is not selected nor desired, channels are opened for input/output in the usual manner.

Since the striping determination is made at run time based on the values of the data definition statements, it is not necessary to modify or recompile any applications which use unnamed open statements for opening files. If it is desired to use striping on a file which was created as unstriped, it is a simple task to write a program which reads in the file on a single channel, and writes it back out as a striped file. It is then available for input to other applications as a striped file.

While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention. 

We claim:
 1. A method of operating a computer system to stripe file data across a plurality of attached disk storage devices, the computer system having means for writing data to the disk storage devices, run time environment means and means for executing programs containing control statements for defining file names in the run time environment means and containing object code including file open statements, comprising the steps of:detecting the execution of an open statement in the object code; querying the run time environment for a definition of a preselected file name and if the preselected file name has been defined in the run time environment performing the following steps: selecting a number (N), greater than one, of stripes if the preselected file name has been defined in the run time environment, the number being derived from the preselected file name; and striping file data associated with the open statement by dividing the file data into N blocks and writing the N blocks to N disk storage devices in parallel.
 2. The method of claim 1 wherein the selecting step further comprises the steps of:isolating a numerical portion of the preselected name; and assigning the numerical portion to N.
 3. A method of operating a computer system to stripe file data across a plurality of attached disk storage devices, the computer system having means for writing data to the disk storage devices, run time environment means and means for executing programs containing control statements for defining file names in the run time environment means and containing object code including file open statements, the system having a predetermined sequence of file names wherein each file name other than a first file name has a predecessor file name and each file name other than a last file name has a next file name, comprising the steps of:detecting the execution of an open statement in the object code; assigning a first file name in a predetermined sequence as a current file name; querying the run time environment for a definition of the current file name and if defined, then assigning a next file name in the predetermined sequence as the current file name; repeating the querying step until the current file name has not been defined in the run time environment; selecting a number (N), greater than one, of stripes based on the the current file name; and striping file data associated with the open statement by dividing the file data into N blocks and writing the N blocks to N disk storage devices in parallel.
 4. The method of claim 3 wherein the selecting step further comprises the steps of:isolating a numerical portion of the current name; and subtracting one from the numerical portion; thereby, calculating N.
 5. The method of claim 3 wherein the assigning a next file name sub-step further comprises the steps of:isolating a numerical portion of the current name; and adding one to the numerical portion; thereby, generating the next file name.
 6. The method of claim 3 wherein the striping step further comprises the step of writing the file data to N physical files using respectively the first N file names from the predetermined sequence of file names.
 7. A computer system for striping file data across a plurality of attached disk storage devices, the computer system having means for writing data to the disk storage devices, run time environment means and means for executing programs containing control statements for defining file names in the run time environment means and containing object code including file open statements, comprising:means, responsive to the executing means, for detecting the execution of an open statement in the object code; means, responsive to the detecting means, for querying the run time environment for a definition of a preselected file name and if the preselected file name has been defined in the run time environment sequentially activating the following means:means for selecting a number (N), greater than one, of stripes if the preselected file name has been defined in the run time environment, the number being derived from the preselected file name; and means for striping file data associated with the open statement by dividing the file data into N blocks and writing the N blocks to N disk storage devices in parallel.
 8. The system of claim 7 wherein the means for selecting further comprises:means for isolating a numerical portion of the preselected name; and means, responsive to the means for isolating, for assigning the numerical portion to N. 